# the minimum version of CMake.
cmake_minimum_required(VERSION 3.5.0)
project(myNpmLib)

set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})

if(DEFINED PACKAGE_FIND_FILE)
    include(${PACKAGE_FIND_FILE})
endif()

include_directories(${NATIVERENDER_ROOT_PATH}
                    ${NATIVERENDER_ROOT_PATH}/include)
set(LOTTIE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules/@ohos/lottie-turbo)
set(LOTTIE_LIB ${LOTTIE_MODULE_PATH}/build/default/intermediates/libs/default/${OHOS_ARCH}/liblottie-turbo.so)
set(LOTTIE_OBJECT_DIR ${LOTTIE_MODULE_PATH}/build/default/intermediates/cmake/default/obj)
set(LOTTIE_BOUNDSCHECK_LIB ${LOTTIE_OBJECT_DIR}/default/${OHOS_ARCH}/libboundscheck.a)
set(LOTTIE_INCLUDE ${LOTTIE_MODULE_PATH}/include)
set(LOTTIE_BOUNDS_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/../../../../library/src/main/cpp/thirdparty/boundscheck)
add_library(examplecpp SHARED napi_init.cpp)
target_link_libraries(examplecpp PUBLIC libace_napi.z.so)
target_link_libraries(examplecpp PUBLIC libhilog_ndk.z.so)
target_link_libraries(examplecpp PUBLIC ${LOTTIE_LIB})
target_include_directories(examplecpp PUBLIC ${LOTTIE_INCLUDE})
target_include_directories(examplecpp PUBLIC ${LOTTIE_BOUNDS_INCLUDE})
